
import React from 'react';
import { Message as M1, Result as R1 } from '../../api/teachgl/xqb/del.api';
import { Message as M2, Result as R2 } from '../../api/teachgl/xqb/edit.api';
import api from '../../../atoms/api';
import DelButton from '../../../components/delbutton';
import Table from '../../../components/table';
import { IData } from '../../api/teachgl/xqb/query.api';
import Edit from '../xqb/edit';

export default function List({ data }: {
	data: IData[];
}) {
	return <>
		<Table
			idfieldname='trem_id'
			data={data}
			render={(record) => {
				const id = record.trem_id;
				return <>
					<Edit data={record} />
					<DelButton query={{
						id
					}} dlgtitle='确认删除' api={api['/api/teachgl/xqb/del']} />
				</>;
			}}
		>
			<Table.Column<IData> title='学期名称' key='trem_name' dataIndex='trem_name' align='left' />
			<Table.Column<IData> title='学期开始时间' key='start_time' dataIndex='start_time' align='left' />
			<Table.Column<IData> title='学期结束时间' key='end_time' dataIndex='end_time' align='left' />
		</Table>
	</>;
}
